package
{
	import com.pickgliss.light2d.display.LightImage;
	import com.pickgliss.light2d.display.LightSprite;
	import com.pickgliss.light2d.display.LightStage;
	import com.pickgliss.loaders.LoaderManager;
	import com.pickgliss.toplevel.StageReferance;
	
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;

	[SWF(width="1000",height="600")]
	public class Power2DTest extends Sprite
	{
		private var _stage2D:LightStage;
		private var _display:LightImage;
		public function Power2DTest()
		{
			if(stage)
			{
				init();
			}else
			{
				addEventListener(Event.ADDED_TO_STAGE,init);
			}
		}
		
		private function init(event:Event = null):void
		{
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			StageReferance.setup(stage);
			LoaderManager.Instance.loadEasy("testPngx.png");
			_stage2D = new LightStage(stage.width,stage.height,25);
			_display = new LightSprite();
			_display.textureId = "testPngx.png";
//			_stage2D.addChild(_display);
			_stage2D.start();
			
			for(var i:int = 0;i<500;i++)
			{
				var dis:LightSprite = new LightSprite();
				dis.textureId = "testPngx.png";
				_stage2D.addChild(dis);
				dis.x = Math.random()*1000-90;
				dis.y = Math.random()*600-60;
			}
			_display.x = 500;
			_display.y = 300;
		}
	}
}